// 引入所有图标组件
import * as Icons from '@ant-design/icons-vue';

export { Icons }
export function getIconComponent(iconName) {
    try {
        // 直接从 Icons 对象中获取图标组件
        const iconComponent = Icons[iconName];
        if (!iconComponent) {
            throw new Error(`未找到图标组件: ${iconName}`);
        }
        return iconComponent;
    } catch (error) {
        console.error(`未找到图标组件: ${iconName}`, error);
        return null;
    }
}